package org.example.demos.pattern.singleton;

public class Singleton {
    private static final Singleton instance = new Singleton();

    private Singleton(){}

    public static Singleton getInstance(){
        return instance;
    }

    public void getMessage(){
        System.out.println("singleton pattern");
    }

    private static class SingletonHolder{
        private static final Singleton instance = new Singleton();
    }
}
